package message.visitor.singleton;

import message.types.message.RejectedRequest;
import message.types.unique.EmptyMessage;
import message.visitor.MessageVisitor;
import stalker.Stalker;

public class StalkerManagerMessageVisitor extends MessageVisitor<Void> {
  
  @Override
  public Void visit(EmptyMessage getEmptyMsg) {
    return null;
  }

  @Override
  public Void visit(RejectedRequest rejectedRequest) {
    
    assert rejectedRequest != null;
    
    if (rejectedRequest.getDestination().equals(Stalker.STALKER_MANAGER)) {
      // message arrived
      assert false;
    } else {
      relayMessage(rejectedRequest);
    }
    
    return null;
  }

}
